home *** CD-ROM | disk | FTP | other *** search
- Path: news.iag.net!news
- From: jatmon@iag.net (John R Buchan)
- Newsgroups: comp.lang.c
- Subject: Re: Keyboard input: C's equivalent to BASIC's Inkey$
- Date: 14 Jan 1996 20:35:13 GMT
- Organization: Internet Access Group, Orlando, Florida
- Message-ID: <4dbpe1$47c@news.iag.net>
- References: <Pine.SUN.3.91.960111212844.17033A@suntan>
- NNTP-Posting-Host: pm3-orl13.iag.net
- X-Newsreader: WinVN 0.99.7
-
- In article <Pine.SUN.3.91.960111212844.17033A@suntan>, cdiaz@eng.usf.edu
- says...
- ->
- ->Hi! Can someone tell me what the C equivalent of BASIC's Inkey$ command
- ->is? In particular, I'm looking to translate the following BASIC code to
- ->C. It's the old, "wait for a key- if there is no key do something else
- ->then wait for a key, etc".
- ->
- ->DO
- -> DO WHILE k$ = "" 'As long as there is no key, keep waiting
- -> k$=Inkey$
- -> ' Additional statements to increment a counter, update and display a
- -> ' clock with running seconds, etc, can go here.
- -> LOOP
- -> PRINT k$; 'Print the key that was just gotten
- -> k$=""
- ->LOOP
-
- There no ansi or truly portable equivalent. The c.l.c faq (Frequently
- Asked Question) list mentions several system specific possiblilties.
- The list is available for anonymous for from ftfm.mit.edu
- /pub/usebet/comp.lang.c.
-
- --
- John R Buchan -:|:- Looking for that elusive FAQ? ftp to:
- jatmon@mail.iag.net -:|:- rtfm.mit.edu /pub/usenet-by-group/....
-
-